<template>
<div class="use-active-element">
  <div>
    <input type="text" value="1"><br/>
    <input type="text" value="2"><br/>
    <input type="text" value="3"><br/>
    <input type="text" value="4"><br/>
    <input type="text" value="5"><br/>
    <input type="text" value="6"><br/>
  </div>
  当前激活的元素是：{{ activeElement.value }}
</div>
</template>
<script setup lang="ts">
import {useActiveElement} from "@vueuse/core";
import {watch} from "vue";

defineOptions({
  name: "useActiveElement"
})

const activeElement = useActiveElement()
watch(activeElement, el => {
  console.log(el)
})
</script>
